{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "euvncfhnncksmdiwxkcm\n",
      "cggfut\n",
      "yfuvbiu"
     ]
    }
   ],
   "source": [
    "with open(r'D:/电子知识库/Vescode/text.txt',encoding=\"utf-8\" ) as f:\n",
    "        for line in f:\n",
    "            print(line, end='')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(r'D:/电子知识库/Vescode/text.txt',\"w\") as f:\n",
    "    namelst = ['张三 ', '李四', '王五']\n",
    "\n",
    "\n",
    "\n",
    "    f.writelines(namelst)\n",
    "\n",
    "   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "保存数据完成!\n"
     ]
    }
   ],
   "source": [
    "import json\n",
    "\n",
    "def main():\n",
    "    mydict = {\n",
    "        'name': '骆昊',\n",
    "        'age': 38,\n",
    "        'qq': 957658,\n",
    "        'friends': ['王大锤', '白元芳'],\n",
    "        'cars': [\n",
    "            {'brand': 'BYD', 'max_speed': 180},\n",
    "            {'brand': 'Audi', 'max_speed': 280},\n",
    "            {'brand': 'Benz', 'max_speed': 320}\n",
    "        ]\n",
    "    }\n",
    "    try:\n",
    "        with open(r'D:/电子知识库/Vescode/text.txt', 'w', encoding='utf-8') as f:\n",
    "            json.dumps(mydict)\n",
    "    except IOError as e:\n",
    "        print(e)\n",
    "    print('保存数据完成!')\n",
    "\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1/2 =0.5\n",
      "1/2+1/4 =0.75\n",
      "1/2+1/4+1/8 =0.875\n",
      "1/2+1/4+1/8+1/16 =0.9375\n",
      "1/2+1/4+1/8+1/16+2^5 =0.96875\n",
      "1/2+1/4+1/8+1/16+2^5+2^6 =0.984375\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7 =0.9921875\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8 =0.99609375\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9 =0.998046875\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10 =0.9990234375\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11 =0.99951171875\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12 =0.999755859375\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13 =0.9998779296875\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14 =0.99993896484375\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15 =0.999969482421875\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16 =0.9999847412109375\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17 =0.9999923706054688\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18 =0.9999961853027344\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19 =0.9999980926513672\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20 =0.9999990463256836\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21 =0.9999995231628418\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22 =0.9999997615814209\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23 =0.9999998807907104\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24 =0.9999999403953552\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25 =0.9999999701976776\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26 =0.9999999850988388\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27 =0.9999999925494194\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28 =0.9999999962747097\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29 =0.9999999981373549\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30 =0.9999999990686774\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31 =0.9999999995343387\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32 =0.9999999997671694\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33 =0.9999999998835847\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34 =0.9999999999417923\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35 =0.9999999999708962\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36 =0.9999999999854481\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37 =0.999999999992724\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38 =0.999999999996362\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39 =0.999999999998181\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40 =0.9999999999990905\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41 =0.9999999999995453\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42 =0.9999999999997726\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43 =0.9999999999998863\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44 =0.9999999999999432\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45 =0.9999999999999716\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46 =0.9999999999999858\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47 =0.9999999999999929\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48 =0.9999999999999964\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49 =0.9999999999999982\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50 =0.9999999999999991\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51 =0.9999999999999996\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52 =0.9999999999999998\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53 =0.9999999999999999\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92+2^93 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92+2^93+2^94 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92+2^93+2^94+2^95 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92+2^93+2^94+2^95+2^96 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92+2^93+2^94+2^95+2^96+2^97 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92+2^93+2^94+2^95+2^96+2^97+2^98 =1.0\n",
      "1/2+1/4+1/8+1/16+2^5+2^6+2^7+2^8+2^9+2^10+2^11+2^12+2^13+2^14+2^15+2^16+2^17+2^18+2^19+2^20+2^21+2^22+2^23+2^24+2^25+2^26+2^27+2^28+2^29+2^30+2^31+2^32+2^33+2^34+2^35+2^36+2^37+2^38+2^39+2^40+2^41+2^42+2^43+2^44+2^45+2^46+2^47+2^48+2^49+2^50+2^51+2^52+2^53+2^54+2^55+2^56+2^57+2^58+2^59+2^60+2^61+2^62+2^63+2^64+2^65+2^66+2^67+2^68+2^69+2^70+2^71+2^72+2^73+2^74+2^75+2^76+2^77+2^78+2^79+2^80+2^81+2^82+2^83+2^84+2^85+2^86+2^87+2^88+2^89+2^90+2^91+2^92+2^93+2^94+2^95+2^96+2^97+2^98+2^99 =1.0\n"
     ]
    }
   ],
   "source": [
    "'''编写程序，将等比数列的前99行 1/2+1/4+1/8+1/16+...+1/2^N 的算式及和写到一个文本文件中。\n",
    "例如：\n",
    "\n",
    "1/2 = 0.5\n",
    "1/2+1/4 = 0.75\n",
    "1/2+1/4+1/8 = 0.875\n",
    "1/2+1/4+1/8+1/16 = ...\n",
    "....\n",
    "....\n",
    "1/2+1/4+1/8+...1/2^99 = ...'''\n",
    "import math\n",
    "def dy(n):\n",
    "    m=[]\n",
    "    for i in range(1,n+1):\n",
    "        a = [\"1/{}\".format(str(2**j))if j<=4 else \"2^\"+str(j)for j in range(1,i+1)]\n",
    "        b= [1/math.pow(2,j)for j in range(1,i+1)]\n",
    "        c = \"{} ={}\".format(\"+\".join(a),sum(b))\n",
    "        m.append(c)\n",
    "    print(\"\\n\".join(m))\n",
    "dy(99)\n",
    "\n",
    "\n",
    "    \n",
    "    \n",
    "\n",
    "\n",
    "\n",
    "    \n",
    "        \n",
    "\n",
    "        \n",
    "        \n",
    "      \n",
    "        \n",
    "\n",
    " \n",
    "  \n",
    "        \n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.0000\n",
      "1.5000\n",
      "1.6667\n",
      "1.6000\n",
      "1.6250\n",
      "1.6154\n",
      "1.6190\n",
      "1.6176\n",
      "1.6182\n",
      "1.6180\n",
      "1.6181\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "1.6180\n",
      "32951280098\n"
     ]
    }
   ],
   "source": [
    "'''课后作业\n",
    "将初始半径为1的 斐波那契弧线（螺旋线） 的前50步的长度和，以及分步与上一步的长度比打印出来。'''\n",
    "a = 1\n",
    "b = 1\n",
    "sums = 0\n",
    "for _ in range(50):\n",
    "    sums +=a\n",
    "    a,b = b,a+b\n",
    "    print(f\"{b/a:.4f}\")\n",
    "print(sums)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.7 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "2dbe5485cf12282196b80a8ac362415f1d4830d1445e2229f35f94c570ef032e"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
